package main.java.tmi.returncause.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import main.java.tmi.common.service.impl.AbstractDao;
import main.java.tmi.returncause.service.ReturncauseVO;

import org.springframework.stereotype.Repository;

/**
 * Returncause Data Access Object (cust Table)
 *
 * @author min™
 * @since 2012. 04. 24
 */
@Repository
public class ReturncauseDAO extends AbstractDao {
	
	/**
	 * Returncause search
	 * @return List<ReturncauseVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<ReturncauseVO> getReturncauseView(Map<String,String> param) throws SQLException {
				
		return (List<ReturncauseVO>) list("ReturncauseDAO.getReturncauseView", param);
	}
	
	/**
	 * Returncause search
	 * @return List<ReturncauseVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public int getReturncauseViewCount(Map<String,String> param) throws SQLException {
		return Integer.parseInt((String) getSqlMapClientTemplate().queryForObject("ReturncauseDAO.getReturncauseViewCount", param));
	}
	
	/**
	 * Returncause search
	 * @return List<ReturncauseVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public Map<String,String>  getReturncauseDetailView(Map<String,String> param) throws SQLException {
		Map<String,String> returnMap ;
        returnMap = (Map<String,String>) selectByPk("ReturncauseDAO.getReturncauseDetailView", param);
        
        return returnMap;
	}
	
	/**
	 * Returncause save
	 * @return void
	 * @throws SQLException 
	 */
	public void addReturncause(Map<String,String> param) throws SQLException {
		insert("ReturncauseDAO.addReturncause", param);
	}
	
	/**
	 * Returncause modify
	 * @return void
	 * @throws SQLException 
	 */
	public void modifyReturncause(Map<String,String> param) throws SQLException {
		insert("ReturncauseDAO.modifyReturncause", param);
	}
	
	/**
	 * Returncause del
	 * @return void
	 * @throws SQLException 
	 */
	public void delReturncause(Map<String,String> param) throws SQLException {
		insert("ReturncauseDAO.delReturncause", param);
	}	
}
